import { defHttp } from '/@/utils/http/axios';
import { ApiCommon } from '../common';

const { CUSTOMER_ADMIN_API } = ApiCommon;

enum Api {
  ADDREES_CHANGE = '/integrated-business/approval/dataChange/meterAddressChange', //用水地址
  NUMBEr_CHCANGE = '/integrated-business/approval/dataChange/familyNumberChange', //用水人口
  INVOICE_CHANGE = '/integrated-business/approval/dataChange/invoiceChange', //修改开票信息
  PHONE_CHANGE = '/integrated-business/approval/dataChange/contactPhoneChange', //修改手机号码
  CONTACT_CHANGE = '/integrated-business/approval/dataChange/contactChange', //联系人变更
  BIND_CONTACT = '/integrated-business/approval/dataChange/approvalBindContact', //绑定联系人
  UNBIND_CONTACT = '/integrated-business/approval/dataChange/approvalUnbindContact', //解绑联系人
  CONTACT_MESSAGE = '/contact/changeMessageAuthority', //是否接受信息
  CATION_CODE = '/sms/sendVerificationCode', //发送手机验证码
  INFO_CHANGE = '/integrated-business/approval/dataChange/infoChange', //修改账户资料地址
}

// 修改地址
export const addreeChange = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.ADDREES_CHANGE, data });

// 修改用水人口
export const numberChange = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.NUMBEr_CHCANGE, data });

// 修改开票信息
export const invoiceChange = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.INVOICE_CHANGE, data });

// 修改手机号码
export const phoneChange = (params: object, data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.PHONE_CHANGE, params, data });

// 联系人变更
export const contactChange = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.CONTACT_CHANGE, data });

// 绑定联系人
export const bindContact = (params: object, data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + Api.BIND_CONTACT, params, data });

// 解绑联系人
export const unbindContact = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.UNBIND_CONTACT, params });

// 发送手机验证码
export const cationCode = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.CATION_CODE, params });

// 是否接受信息
export const contactMessage = (params: object) =>
  defHttp.get({ url: CUSTOMER_ADMIN_API + Api.CONTACT_MESSAGE, params });

// 修改账户资料
export const infoChange = (data: object) =>
defHttp.post({ url: CUSTOMER_ADMIN_API + Api.INFO_CHANGE, data });
